package com.shop.agentDataImpl.shopWindow;


import com.shop.agentDataImpl.ShopWindowDataServer;
import com.shop.dto.factory.SelectFactoryShopWindowDto;
import com.shop.entity.ShopWindowDo;
import com.shop.mapper.ext.ShopWindowDoMapperExt;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("factoryShopWindowDataImpl")
public class FactoryShopWindowDataImpl implements ShopWindowDataServer<SelectFactoryShopWindowDto> {


    @Autowired
    private ShopWindowDoMapperExt shopWindowDoMapperExt;

    @Override
    public List<SelectFactoryShopWindowDto> getClientShopWindowData(ShopWindowDo shopWindowDo) throws Exception {
        List<SelectFactoryShopWindowDto> selectFactoryShopWindowDtos = shopWindowDoMapperExt.selectFactoryShopWindow(shopWindowDo);
        selectFactoryShopWindowDtos.sort(((o1, o2) -> o1.getShopWindowSort().compareTo(o2.getShopWindowSort())));
        return selectFactoryShopWindowDtos;
    }
}
